<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<style type="text/css">
.dateWidth1 {
	width: 195px;
}
.select_width {
	width: 130px;
}
</style>
<input type="hidden" name="organization/whether_is_gaoxin_value" value="<x:out select="$xmlData/data/organization/whether_is_gaoxin_value" />"/>
<input type="hidden" name="organization/whether_industrial_base_value" value="<x:out select="$xmlData/data/organization/whether_industrial_base_value" />"/>
<input type="hidden" name="organization/whether_is_province_value" value="<x:out select="$xmlData/data/organization/whether_is_province_value" />"/>
<input type="hidden" name="proposal/contact_psn_tel" value="<x:out select="$xmlData/data/organization_persons/organization_person[@psn_type='lianxiren']/contact_tel"/>"/>
<input type="hidden" name="proposal/contact_psn_email" value="<x:out select="$xmlData/data/organization_persons/organization_person[@psn_type='lianxiren']/contact_email"/>"/>


<table class="t_css table01" id="table_1" width="100%" border="0" cellpadding="0" id="basicInfo" cellspacing="1">
	<col style="width: 20%" />
	<col style="width: 30%" />
	<col style="width: 20%" />
	<col style="width: 30%" />

	<tr>
		<td colspan="4" class="t_bar2">${param.title}</td>
	</tr>
	<tr>
		<td align="right">项目类别：</td>
		<td colspan="3">
			<span name='proposal/sub_grant_name'><x:out select="$xmlData/data/proposal/sub_grant_name" /></span>
		</td>
	</tr>
	<tr>
		<td align="right"><span class="color_red">*</span>孵化器名称：</td>
		<td colspan="3"><input type="text" id="fuhuaqi_name" name="proposal/zh_title" label="孵化器名称" class="input_css required maxlength:100"
			style="width:80%;" maxlength="100" value="<x:out select="$xmlData/data/proposal/zh_title" />" /></td>
	</tr>
	<tr>
		<td align="right">运营主体（盖章）：</td>
		<td colspan="3">
			<span name='organizations/organization/org_name'><x:out select="$xmlData/data/organizations/organization/org_name"/></span>
		</td>
	</tr>
	<tr>
		<td align="right"><span class="color_red">*</span>孵化器性质：</td>
		<td colspan="3">
			<c:set var="fuhuaqi_natures"><x:out select="$xmlData/data/proposal/fuhuaqi_nature_value" /></c:set>
			<cpt:checkbox key="operation_main_natures" style="vertical-align: middle;" name="fuhuaqi_nature" width="70px" repeatColumn="4" value="${fuhuaqi_natures }"  tagType="radio" ></cpt:checkbox>
			<input type="hidden" id="fuhuaqi_nature_value" name="proposal/fuhuaqi_nature_value"  class="required" value="${fuhuaqi_natures }" label="孵化器性质">
			<input type="hidden" id="fuhuaqi_nature_name" name="proposal/fuhuaqi_nature_name" value="<x:out select="$xmlData/data/proposal/fuhuaqi_nature_name" />">
			<!-- 其他的值 -->
			<input type="hidden" id="fuhuaqi_nature_other" name="proposal/fuhuaqi_nature_other" label="孵化器性质-->其他" value="<x:out select="$xmlData/data/proposal/fuhuaqi_nature_other" />"/>
			<input type="hidden" id="enterprise_type_other" name="proposal/enterprise_type_other" label="孵化器性质-->企业-->国有或民营" value="<x:out select="$xmlData/data/proposal/enterprise_type_other" />"/>
		</td>
	</tr>
	<tr style="background: #f1f1f1;">
		<td align="right"><span class="color_red">*</span>孵化器级别：</td>
		<td colspan="3">
			<c:set var="fuhuaqi_level_value"><x:out select="$xmlData/data/proposal/fuhuaqi_level_value" /></c:set>
			<cpt:checkbox key="fuhuaqi_level" name="proposal/fuhuaqi_level" width="70px" repeatColumn="2" value="${fuhuaqi_level_value }" tagType="radio"></cpt:checkbox>
			<input type="hidden" id="fuhuaqi_level_value" name="proposal/fuhuaqi_level_value" class="required" value="${fuhuaqi_level_value}" label="孵化器级别">
			<input type="hidden" name="proposal/fuhuaqi_level_name" value="<x:out select="$xmlData/data/proposal/fuhuaqi_level_name" />">
		</td>
	</tr>
	<tr style="background: #f1f1f1;">
		<td align="right"><span class="color_red">*</span>孵化器类型：</td>
		<td colspan="3">
 			<c:set var="fuhuaqi_type_value"><x:out select="$xmlData/data/proposal/fuhuaqi_type_value" /></c:set>
			<cpt:checkbox key="fuhuaqi_type" name="proposal/fuhuaqi_type" width="70px" repeatColumn="2" value="${fuhuaqi_type_value }" tagType="radio"></cpt:checkbox>
			<input type="hidden" id="fuhuaqi_type_value" name="proposal/fuhuaqi_type_value" class="required" value="${fuhuaqi_type_value}" label="孵化器类型">
			<input type="hidden" name="proposal/fuhuaqi_type_name" value="<x:out select="$xmlData/data/proposal/fuhuaqi_type_name" />">
		</td>
	</tr>
	<tr>
		<td align="right" >注册时间 ：</td>
		<td align="center"><span name="proposal/regist_time"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/registe_date" /></span></td>
		<td align="right" ><span class="color_red">*</span>开始运营时间：</td>
		<td colspan="5"> <c:set var="start_date"><x:out select="$xmlData/data/proposal/start_date" /></c:set>
			<cpt:date id="start_date"  name="proposal/start_date" value="${start_date}" className="required date" label="开始运营时间" ></cpt:date>
		</td>
	</tr>
	<tr>
		<td align="right">注册资本：</td>
		<td align="center"><span name="proposal/regist_zibeng"><x:out select="$xmlData/data/org_basic_info/registe_fund" />
		（万<x:out select="$xmlData/data/organizations/organization[@submit_org='1']/registe_fund_money_name" />）</span></td>
		<%--<td align="right">注册地址 ：</td>
		<td align="left"><span name="proposal/regist_address"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/area_name" /></span></td>--%>
		<td align="right"><span class="color_red">*</span>注册地址：</td>
		<td align="left"><input
				name="proposal/register_address" label="注册地址" type="text" maxlength="100"
				class="input_css required"
				value="<x:out select="$xmlData/data/proposal/register_address" />" /></td>
	</tr>
	<tr>
		<td align="right">项目负责人：</td>
		<td><span name='proposal/fzr_psnname'><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name" /></span></td>
		<td align="right">电子邮箱：</td>
		<td><span name='proposal/fzr_email'><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email" /></span></td>
	</tr>
	<tr>
		<td align="right">手机号码：</td>
		<td><span name='proposal/fzr_mobile'><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile" /></span></td>
		<td align="right">联系电话：</td>
		<td><span name='proposal/fzr_tel'><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work" /> </span></td>
	</tr>
	<tr>
		<td align="right" ><span class="color_red">*</span>联系人：</td>
		<td><input type="text" name="proposal/linkman_name" label="联系人" class="input_css required" maxlength="50" value="<x:out select="$xmlData/data/proposal/linkman_name" />"/></td>
		<td align="right" ><span class="color_red">*</span>联系电话：</td>
		<td><input type="text" name="proposal/linkman_phone" label="联系电话" class="input_css required " maxlength="20" value="<x:out select="$xmlData/data/proposal/linkman_phone" />"/></td>
	</tr>
	<tr>
		<td align="right"> <span class="color_red">*</span>归口管理单位：</td>
		<td>
			<c:set var="recomend_org">{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value"/>','name':'<x:out
					select="$xmlData/data/proposal/recomend_org_name"/>'}</c:set>
			<cpt:tree key="recommended_org" cacheable="false" className="hn_iuput_kuang " readonly="true"
					  value="${recomend_org}" label="归口管理单位"
					  id="recomend_org" onlyChooseLeaf="false" showPattern="all" shieldPattern="0" topCheckbox="true"
					  onClick="initTreeValueExt"/>
			<input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value" class="required"
				   value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理单位">
			<input type="hidden" name="proposal/recomend_org_name"
				   value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
		</td>
		<td align="right" ><span class="color_red">*</span>申报日期：</td>
		<td> <c:set var="submit_date"><x:out select="$xmlData/data/proposal/submit_date" /></c:set>
			<cpt:date id="apply_date_curr"  name="proposal/submit_date" value="${submit_date}" className="required date" label="申报日期" ></cpt:date>
		</td>
	</tr>
</table>
<table class="t_css table01" id="table_2" width="100%" border="0" cellpadding="0" id="basicInfo" cellspacing="1">
	<col style="width: 20%" />
	<col style="width: 30%" />
	<col style="width: 20%" />
	<col style="width: 30%" />
	<tr>
		<td colspan="4" class="t_bar2">绩效评价指标</td>
	</tr>
	<tr>
		<td align="right" ><span class="color_red">*</span>当年在孵企业数（家）：</td>
		<td colspan="3"><input type="text" id="qiye_num" name="proposal/qiye_num" label="当年在孵企业数" onfocus="InitInput.setNumber(this,9,0,0);"
							   onchange="ratio('qiye_add','qiye_num','qiye_add_ratio');ratio('qiye_biye','qiye_num','qiye_biye_ratio');
								ratio('chuanquan','qiye_num','chuanquan_average');ratio('income','qiye_num','income_average');
								ratio('employment','qiye_num','employment_average')"
				   class="input_css required" style="text-align: right;" value="<x:out select="$xmlData/data/proposal/qiye_num" />"/></td>
	</tr>
	<tr>
		<td align="right"><span class="color_red">*</span>当年新增在孵企业数（家）：</td>
		<td><input type="text" id="qiye_add" name="proposal/qiye_add" label="当年新增在孵企业数" onfocus="InitInput.setNumber(this,9,0,0);"
				   onchange="ratio('qiye_add','qiye_num','qiye_add_ratio')"
				   class="input_css required" style="text-align: right;" value="<x:out select="$xmlData/data/proposal/qiye_add" />"/></td>
		<td align="right">当年新增在孵企业数占<br/>当年在孵企业数的比例（%）：</td>
		<td><input type="text" id="qiye_add_ratio" name="proposal/qiye_add_ratio" label="当年新增在孵企业数占当年在孵企业数的比例" onfocus="InitInput.setNumber(this,9,2,2);"
				   class="input_css gray" disabled style="text-align: right;" value="<x:out select="$xmlData/data/proposal/qiye_add_ratio" />"/></td>
	</tr>
	<tr>
		<td align="right"><span class="color_red">*</span>当年新增毕业企业数（家）：</td>
		<td><input type="text" id="qiye_biye" name="proposal/qiye_biye" label="当年新增毕业企业数" onfocus="InitInput.setNumber(this,9,0,0);"
				   onchange="ratio('qiye_biye','qiye_num','qiye_biye_ratio')"
				   class="input_css required" style="text-align: right;" value="<x:out select="$xmlData/data/proposal/qiye_biye" />"/></td>
		<td align="right">当年新增毕业企业数占<br/>当年在孵企业数的比例（%）：</td>
		<td><input type="text" id="qiye_biye_ratio" name="proposal/qiye_biye_ratio" label="当年新增毕业企业数占当年在孵企业数的比例" onfocus="InitInput.setNumber(this,9,2,2);"
				   class="input_css gray" disabled style="text-align: right;" value="<x:out select="$xmlData/data/proposal/qiye_biye_ratio" />"/></td>
	</tr>
	<tr>
		<td align="right"><span class="color_red">*</span>在孵企业当年新增<br/>授权知识产权数（项）：</td>
		<td><input type="text" id="chuanquan" name="proposal/chuanquan" label="在孵企业当年新增授权知识产权数" onfocus="InitInput.setNumber(this,9,0,0);"
				   onchange="ratio('chuanquan','qiye_num','chuanquan_average')"
				   class="input_css required" style="text-align: right;" value="<x:out select="$xmlData/data/proposal/chuanquan" />"/></td>
		<td align="right">当年在孵企业平均每家<br/>新增授权知识产权数（项）：</td>
		<td><input type="text" id="chuanquan_average" name="proposal/chuanquan_average" label="当年在孵企业平均每家新增授权知识产权数" onfocus="InitInput.setNumber(this,9,0,0);"
				   class="input_css gray" disabled style="text-align: right;" value="<x:out select="$xmlData/data/proposal/chuanquan_average" />"/></td>
	</tr>
	<tr>
		<td align="right"><span class="color_red">*</span>在孵企业当年营业收入<br/>（万元）：</td>
		<td><input type="text" id="income" name="proposal/income" label="在孵企业当年营业收入" onfocus="InitInput.setNumber(this,9,2,2);"
				   onchange="ratio('income','qiye_num','income_average')"
				   class="input_css required" style="text-align: right;" value="<x:out select="$xmlData/data/proposal/income" />"/></td>
		<td align="right">当年在孵企业平均每家营业收入（万元）：</td>
		<td><input type="text" id="income_average" name="proposal/income_average" label="当年在孵企业平均每家营业收入" onfocus="InitInput.setNumber(this,9,2,2);"
				   class="input_css gray" disabled style="text-align: right;" value="<x:out select="$xmlData/data/proposal/income_average" />"/></td>
	</tr>
	<tr>
		<td align="right"><span class="color_red">*</span>在孵企业吸纳就业总数（人）：</td>
		<td><input type="text" id="employment" name="proposal/employment" label="在孵企业吸纳就业总数" onfocus="InitInput.setNumber(this,9,0,0);"
				   onchange="ratio('employment','qiye_num','employment_average')"
				   class="input_css required" style="text-align: right;" value="<x:out select="$xmlData/data/proposal/employment" />"/></td>
		<td align="right">当年在孵企业平均每家吸纳就业人数（人）：</td>
		<td><input type="text" id="employment_average" name="proposal/employment_average" label="当年在孵企业平均每家吸纳就业人数" onfocus="InitInput.setNumber(this,9,0,0);"
				   class="input_css gray" disabled style="text-align: right;" value="<x:out select="$xmlData/data/proposal/employment_average" />"/></td>
	</tr>
</table>
<script type="text/javascript">

	//文本框只显示下边框
	$(".survey").css({
		"border":"none",
		"border-bottom":"1px solid black",
		"text-align":"right",
		"width":30,
	});

	//创建节点
	var operation_subject4 = '<span><input type="text" label="其他" id="radio4" style="height: 17px;width: 120px;border: none;border-bottom: 1px solid gray;background-color: #fbfbfb;" maxlength="50" class="required" value="" onblur="setValByRadio4();" /></span>';
	var enterprise_type ='<span id="enterprise_type">' +
			'（<input type="radio" label="国有" id="stateEnterprise" value="4" name="enterprise_type" onblur="setValByRadio5()">国有' +
			'  <input type="radio" label="民营" id="privateEnterprise" value="5" name="enterprise_type" onblur="setValByRadio6()">民营）'+
			'</span>';

	//初始化radio  operation_subject_nature_other
	if($('input:radio[name="fuhuaqi_nature"]:checked').val()==3){
		$("input[name='fuhuaqi_nature']").parent().parent().parent().find('td').last('label').append(operation_subject4);
		var radio4_hidden = $("#fuhuaqi_nature_other").val();
		$("#radio4").val(radio4_hidden);
		$("#fuhuaqi_nature_other").addClass("required");
	}

	//初始化radio(企业) enterprise_type
	if($('input:radio[name="fuhuaqi_nature"]:checked').val()==2){
		$("input[name='fuhuaqi_nature']").parent().parent().parent().find('td').has("label").eq(1).append(enterprise_type);
		var enterpriseTypeHidden =$("#enterprise_type_other").val();
		//当获取值隐藏值为4时，选中国有企业状态
		if(enterpriseTypeHidden==4){
			$("#stateEnterprise").attr('checked','true');
		}
		//当获取值隐藏值为5时，选中民营企业状态
		if(enterpriseTypeHidden==5){
			$("#privateEnterprise").attr('checked','true');
		}
		$("#enterprise_type_other").addClass("required");

	}

	//初始化radio  institutional_type_other
	if($('input:radio[name="institutional_type"]:checked').val()==2){
		$("input[name='institutional_type']").parent().parent().parent().find('td').last('label').append(institutional_type2);
		var radio2_hidden = $("#institutional_type_other").val();
		$("#radio2").val(radio2_hidden);
		$("#institutional_type_other").addClass("required");
	}

	//对radio须注明选项的值赋值给隐藏域 fuhuaqi_nature_other
	function setValByRadio4(){
		var radio4 = $("#radio4").val();
		$("#fuhuaqi_nature_other").val(radio4);
	}
	//对隐藏域 enterprise_type_other 进行赋值
	function setValByRadio5(){
		var radio5 = $("#stateEnterprise").val();
		$("#enterprise_type_other").val(radio5);
	}
	//对隐藏域 enterprise_type_other 进行赋值
	function setValByRadio6(){
		var radio6 = $("#privateEnterprise").val();
		$("#enterprise_type_other").val(radio6);
	}
	//当运营主体性质被其他选中，则显示输入框，被企业选中时，则显示单选框
	$("input[name='fuhuaqi_nature']").click(function(){
		var val=$('input:radio[name="fuhuaqi_nature"]:checked').val();
		//选中其他时的判断
		if(val==3){
			$(this).parent().parent().parent().find('span').remove();
			if($(this).parent().parent().parent().find('span').length<=0){
				$(this).parent().parent().parent().find('td').last('label').append(operation_subject4);
				$("#fuhuaqi_nature_other").addClass("required");
			}
		} else{
			$("#fuhuaqi_nature_other").removeClass("required");
			$("#fuhuaqi_nature_other").val("");
			$(this).parent().parent().parent().find('span').remove();
		}
		//选中企业时的状态赋值
		if(val==2){
			$(this).parent().parent().parent().find('span').remove();
			if($(this).parent().parent().parent().find('span').length<=0){
				$(this).parent().parent().parent().find('td').has("label").eq(1).append(enterprise_type);
				$("#enterprise_type_other").addClass("required");
			}
		}else {
			$("#enterprise_type_other").removeClass("required");
			$("#enterprise_type_other").val("");
			$(this).parent().parent().parent().find('span[id="institutional_type"]').remove();
		}
	});

	function ratio(num,total,targetId){
		var rationumber = 0.00;
		var num = $("#" + num).val();
		var total = $("#" + total).val();
		if (num == undefined || isNaN(num) || total == undefined || isNaN(total)) {
			return;
		}
		if (num == 0 || total == 0 || num == '' || total == ''){
			rationumber = 0;
		}else {
			if(targetId == 'qiye_add_ratio' || targetId == 'qiye_biye_ratio'){
				rationumber = Math.round(num / total * 10000) / 100.00;
				if(rationumber>100){
					rationumber = 100;
				}
			}else if (targetId =='chuanquan_average' || targetId == 'employment_average'){
				if(num % total == 0){
                    rationumber = num / total;
                }else {
                    rationumber = formatNumberAuto(((num*10000 / total) / 10000).toFixed(2).toString(), 9, 2, 2);
                }
			}else if (targetId == 'income_average'){
                rationumber = formatNumberAuto(((num*10000 / total) / 10000).toFixed(2).toString(), 9, 2, 2);
            }
		}
		$("#" + targetId).val(rationumber);
	}

 function initTreeValueExt(treeId, treeNode) {
	 	if ((treeNode && treeNode.isParent)) {
	 		scmWarn("请选择具体的" + $("#" + treeId).attr("label"));
	 		$("#" + treeId).val("");
	 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
	 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId	+ "_value']").val("");
	 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
	 		return false;
	 	}
	 	var str = treeNode.name;
	 	var obj = treeNode.parentNode;
	 	while (obj != null) {
	 		str = obj.name + "-" + str;
	 		obj = obj.parentNode;
	 	}
	 	
	 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
	 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
	 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
	 } 
</script>
